home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / util / arc / xadmasterdev.lha / xad / Include / ASM / libraries / xadmaster.i
Text File  |  2000-12-03  |  25KB  |  612 lines

  1.     IFND    LIBRARIES_XADMASTER_I
  2. LIBRARIES_XADMASTER_I    SET    1
  3.  
  4. *
  5. *    $VER: xadmaster.i 9.0 (10.11.2000)
  6. *    xadmaster.library defines and structures
  7. *
  8. *    Copyright © 1998-2000 by Dirk Stöcker
  9. *    All Rights Reserved.
  10. *
  11.  
  12.     IFND    EXEC_LIBRARIES_I
  13.     INCLUDE    "exec/libraries.i"
  14.     ENDC
  15.  
  16.     IFND    UTILITY_TAGITEM_I
  17.     INCLUDE    "utility/tagitem.i"
  18.     ENDC
  19.  
  20. XADNAME    MACRO
  21.     DC.B  'xadmaster.library',0
  22.     ENDM
  23.  
  24. * NOTE: The structures do not have size labels, as they have no fixed
  25. * size. You always need to call xadAllocObject to get them
  26.  
  27. *************************************************************************
  28. *                                                *
  29. *    library base structure                        *
  30. *                                                *
  31. *************************************************************************
  32.  
  33.     STRUCTURE xadMasterBase,LIB_SIZE
  34.     APTR    xmb_SysBase
  35.     APTR    xmb_DOSBase
  36.     APTR    xmb_UtilityBase
  37.     ULONG    xmb_RecogSize        * read only
  38.       APTR    xmb_DefaultName        * name for XADFIF_NOFILENAME (V6)
  39.  
  40. *************************************************************************
  41. *                                                *
  42. *    tag-function call flags                               *
  43. *                                                *
  44. *************************************************************************
  45.  
  46. * input tags for xadGetInfo, only one can be specified per call
  47. XAD_INSIZE        EQU    (TAG_USER+001) * input data size
  48. XAD_INFILENAME        EQU    (TAG_USER+002)
  49. XAD_INFILEHANDLE    EQU    (TAG_USER+003)
  50. XAD_INMEMORY        EQU    (TAG_USER+004)
  51. XAD_INHOOK        EQU    (TAG_USER+005)
  52. XAD_INSPLITTED        EQU    (TAG_USER+006) * (V2)
  53. XAD_INDISKARCHIVE    EQU    (TAG_USER+007) * (V4)
  54. XAD_INXADSTREAM        EQU    (TAG_USER+008) * (V8)
  55.  
  56. * output tags, only one can be specified per call, xadXXXXUnArc
  57. XAD_OUTSIZE        EQU    (TAG_USER+010) * output data size
  58. XAD_OUTFILENAME        EQU    (TAG_USER+011)
  59. XAD_OUTFILEHANDLE    EQU    (TAG_USER+012)
  60. XAD_OUTMEMORY        EQU    (TAG_USER+013)
  61. XAD_OUTHOOK        EQU    (TAG_USER+014)
  62. XAD_OUTDEVICE        EQU    (TAG_USER+015) * for disk archives only
  63. XAD_OUTXADSTREAM    EQU    (TAG_USER+016) * (V8)
  64.  
  65. * object allocation tags for xadAllocObjectA
  66. XAD_OBJNAMESIZE        EQU    (TAG_USER+020) * XADOBJ_FILEINFO, size of needed name space
  67. XAD_OBJCOMMENTSIZE    EQU    (TAG_USER+021) * XADOBJ_FILEINFO, size of needed comment space
  68. XAD_OBJPRIVINFOSIZE    EQU    (TAG_USER+022) * XADOBJ_FILEINFO & XADOBJ_DISKINFO, self use size
  69. XAD_OBJBLOCKENTRIES    EQU    (TAG_USER+023) * XADOBJ_DISKINFO, number of needed entries
  70.  
  71. * tags for xadGetInfo, xadFileUnArc and xadDiskUnArc
  72. XAD_NOEXTERN        EQU    (TAG_USER+050) * do not use extern clients
  73. XAD_PASSWORD        EQU    (TAG_USER+051) * password when needed
  74. XAD_ENTRYNUMBER        EQU    (TAG_USER+052) * number of wanted entry
  75. XAD_PROGRESSHOOK    EQU    (TAG_USER+053) * the progress hook
  76. XAD_OVERWRITE        EQU    (TAG_USER+054) * overwrite file ?
  77. XAD_MAKEDIRECTORY    EQU    (TAG_USER+055) * create directory tree
  78. XAD_IGNOREGEOMETRY    EQU    (TAG_USER+056) * ignore drive geometry ?
  79. XAD_LOWCYLINDER        EQU    (TAG_USER+057) * lowest cylinder
  80. XAD_HIGHCYLINDER    EQU    (TAG_USER+058) * highest cylinder
  81. XAD_VERIFY        EQU    (TAG_USER+059) * verify for disk hook
  82. XAD_NOKILLPARTIAL    EQU    (TAG_USER+060) * do not delete partial/corrupt files (V3.3)
  83. XAD_FORMAT        EQU    (TAG_USER+061) * format output device (V5)
  84. XAD_USESECTORLABELS    EQU    (TAG_USER+062) * sector labels are stored on disk (V9)
  85.  
  86. * input tags for xadConvertDates, only one can be passed
  87. XAD_DATEUNIX        EQU    (TAG_USER+070) * unix date variable
  88. XAD_DATEAMIGA        EQU    (TAG_USER+071) * amiga date variable
  89. XAD_DATEDATESTAMP    EQU    (TAG_USER+072) * struct DateStamp
  90. XAD_DATEXADDATE        EQU    (TAG_USER+073) * struct xadDate
  91. XAD_DATECLOCKDATA    EQU    (TAG_USER+074) * struct ClockData
  92. XAD_DATECURRENTTIME    EQU    (TAG_USER+075) * input is system time
  93. XAD_DATEMSDOS        EQU    (TAG_USER+076) * MS-DOS packed format (V2)
  94. XAD_DATEMAC        EQU    (TAG_USER+077) * Mac date variable (V8)
  95.  
  96. * output tags, there can be specified multiple tags for one call
  97. XAD_GETDATEUNIX     EQU    (TAG_USER+080) * unix date variable
  98. XAD_GETDATEAMIGA    EQU    (TAG_USER+081) * amiga date variable
  99. XAD_GETDATEDATESTAMP    EQU    (TAG_USER+082) * struct DateStamp
  100. XAD_GETDATEXADDATE    EQU    (TAG_USER+083) * struct xadDate
  101. XAD_GETDATECLOCKDATA    EQU    (TAG_USER+084) * struct ClockData
  102. XAD_GETDATEMSDOS    EQU    (TAG_USER+086) * MS-DOS packed format (V2)
  103. XAD_GETDATEMAC        EQU    (TAG_USER+087) * Mac date variable (V8)
  104.  
  105. * following tags need locale.library to be installed
  106. XAD_MAKEGMTDATE        EQU    (TAG_USER+090) * make local to GMT time
  107. XAD_MAKELOCALDATE    EQU    (TAG_USER+091) * make GMT to local time
  108.  
  109. * tags for xadHookTagAccess (V3)
  110. XAD_USESKIPINFO        EQU    (TAG_USER+104) * the hook uses xadSkipInfo (V3)
  111. XAD_SECTORLABELS    EQU    (TAG_USER+105) * pass sector labels with XADAC_WRITE (V9)
  112.  
  113. XAD_GETCRC16        EQU    (TAG_USER+120) * pointer to UWORD value (V3)
  114. XAD_GETCRC32        EQU    (TAG_USER+121) * pointer to ULONG value (V3)
  115.  
  116. XAD_CRC16ID        EQU    (TAG_USER+130) * ID for crc calculation (V3)
  117. XAD_CRC32ID        EQU    (TAG_USER+131) * ID for crc calculation (V3)
  118.  
  119. * tags for xadConvertProtection (V4)
  120. XAD_PROTAMIGA        EQU    (TAG_USER+160) * Amiga type protection bits (V4)
  121. XAD_PROTUNIX        EQU    (TAG_USER+161) * protection bits in UNIX mode (V4)
  122. XAD_PROTMSDOS        EQU    (TAG_USER+162) * MSDOS type protection bits (V4)
  123.  
  124. XAD_GETPROTAMIGA    EQU    (TAG_USER+170) * return Amiga protection bits (V4)
  125.  
  126. * tags for xadGetDiskInfo (V7)
  127. XAD_STARTCLIENT        EQU    (TAG_USER+180) * the client to start with (V7)
  128. XAD_NOEMPTYERROR    EQU    (TAG_USER+181) * do not create XADERR_EMPTY (V8)
  129.  
  130. * tags for xadFreeHookAccess (V8)
  131. XAD_WASERROR        EQU    (TAG_USER+190) * error occured, call abort method (V8)
  132.  
  133. * tags for miscellaneous stuff
  134. XAD_ARCHIVEINFO        EQU    (TAG_USER+200) * xadArchiveInfo for stream hooks (V8)
  135.  
  136. *************************************************************************
  137. *                                                *
  138. *    objects for xadAllocObjectA                           *
  139. *                                                *
  140. *************************************************************************
  141.  
  142. XADOBJ_ARCHIVEINFO    EQU    $0001 * struct xadArchiveInfo
  143. XADOBJ_FILEINFO        EQU    $0002 * struct xadFileInfo
  144. XADOBJ_DISKINFO        EQU    $0003 * struct xadDiskInfo
  145. XADOBJ_HOOKPARAM    EQU    $0004 * struct HookParam
  146. XADOBJ_DEVICEINFO    EQU    $0005 * struct xadDeviceInfo
  147. XADOBJ_PROGRESSINFO    EQU    $0006 * struct xadProgressInfo
  148. XADOBJ_TEXTINFO        EQU    $0007 * struct xadTextInfo
  149. XADOBJ_SPLITFILE    EQU    $0008 * struct xadSplitFile (V2)
  150. XADOBJ_SKIPINFO        EQU    $0009 * struct xadSkipInfo (V3)
  151. XADOBJ_IMAGEINFO    EQU    $000A * struct xadImageInfo (V4)
  152.  
  153. * result type of xadAllocVec
  154. XADOBJ_MEMBLOCK        EQU    $0100 * memory of requested size and type
  155.  
  156. *************************************************************************
  157. *                                                *
  158. *    modes for xadCalcCRC126 and xadCalcCRC32                *
  159. *                                                *
  160. *************************************************************************
  161.  
  162. XADCRC16_ID1        EQU    $A001
  163. XADCRC32_ID1        EQU    $EDB88320
  164.  
  165. *************************************************************************
  166. *                                                *
  167. *    hook related stuff                                *
  168. *                                                *
  169. *************************************************************************
  170.  
  171. XADHC_READ    EQU    1    * read data into buffer
  172. XADHC_WRITE    EQU    2    * write buffer data to file/memory
  173. XADHC_SEEK    EQU    3    * seek in file
  174. XADHC_INIT    EQU    4    * initialize the hook
  175. XADHC_FREE    EQU    5    * end up hook work, free stuff
  176. XADHC_ABORT    EQU    6    * an error occured, delete partial stuff
  177. XADHC_FULLSIZE    EQU    7    * complete input size is needed
  178. XADHC_IMAGEINFO    EQU    8    * return disk image info (V4)
  179.  
  180.     STRUCTURE xadHookParam,0
  181.       ULONG    xhp_Command
  182.     ULONG    xhp_CommandData
  183.     APTR    xhp_BufferPtr
  184.       LONG    xhp_BufferSize
  185.       LONG    xhp_DataPos    * current seek position
  186.       APTR    xhp_PrivatePtr
  187.     APTR    xhp_TagList    * allows to transport tags to hook (V9)
  188.  
  189. * xadHookAccess commands
  190. XADAC_READ        EQU    10    * get data
  191. XADAC_WRITE        EQU    11    * write data
  192. XADAC_COPY        EQU    12    * copy input to output
  193. XADAC_INPUTSEEK        EQU    13    * seek in input file
  194. XADAC_OUTPUTSEEK    EQU    14    * seek in output file
  195.  
  196. *************************************************************************
  197. *                                                *
  198. *    support structures                              *
  199. *                                                *
  200. *************************************************************************
  201.  
  202. * Own date structure to cover all possible dates in a human friendly
  203. * format. xadConvertDates may be used to convert between different date
  204. * structures and variables.
  205.     STRUCTURE xadDate,0
  206.       ULONG     xd_Micros    * values 0 to 999999
  207.       LONG      xd_Year         * values 1 to 2147483648
  208.       UBYTE     xd_Month    * values 1 to 12
  209.       UBYTE     xd_WeekDay    * values 1 to 7
  210.       UBYTE     xd_Day        * values 1 to 31
  211.       UBYTE     xd_Hour        * values 0 to 23
  212.       UBYTE     xd_Minute    * values 0 to 59
  213.       UBYTE     xd_Second    * values 0 to 59
  214.       LABEL     xadDate_SIZE
  215.  
  216. XADDAY_MONDAY        EQU    1    * monday is the first day and
  217. XADDAY_TUESDAY        EQU    2
  218. XADDAY_WEDNESDAY    EQU    3
  219. XADDAY_THURSDAY        EQU    4
  220. XADDAY_FRIDAY        EQU    5
  221. XADDAY_SATURDAY     EQU    6
  222. XADDAY_SUNDAY        EQU    7    * sunday the last day of a week
  223.  
  224.     STRUCTURE xadDeviceInfo,0    * for XAD_OUTDEVICE tag
  225.     APTR    xdi_DeviceName    * name of device
  226.     ULONG    xdi_Unit    * unit of device
  227.     APTR    xdi_DOSName    * instead of Device+Unit, dos name without ':'
  228.  
  229.     STRUCTURE xadSplitFile,0    * for XAD_INSPLITTED
  230.       APTR    xsf_Next
  231.     ULONG    xsf_Type    * XAD_INFILENAME, XAD_INFILEHANDLE, XAD_INMEMORY, XAD_INHOOK
  232.     ULONG    xsf_Size    * necessary for XAD_INMEMORY, useful for others
  233.     ULONG    xsf_Data    * FileName, Filehandle, Hookpointer or Memory
  234.  
  235.     STRUCTURE xadSkipInfo,0
  236.     APTR    xsi_Next
  237.     ULONG    xsi_Position    * position, where it should be skipped
  238.     ULONG    xsi_SkipSize    * size to skip
  239.  
  240.     STRUCTURE xadImageInfo,0    * for XADHC_IMAGEINFO
  241.     ULONG xii_SectorSize    * usually 512
  242.     ULONG xii_FirstSector    * of the image file
  243.     ULONG xii_NumSectors    * of the image file
  244.     ULONG xii_TotalSectors    * of this device type
  245.     * If the image file holds total data of disk xii_TotalSectors equals
  246.        * xii_NumSectors and xii_FirstSector is zero. Addition of xii_FirstSector
  247.     * and xii_NumSectors cannot exceed xii_TotalSectors value!
  248.  
  249. *************************************************************************
  250. *                                                *
  251. *    information structures                              *
  252. *                                                *
  253. *************************************************************************
  254.  
  255.     STRUCTURE xadArchiveInfo,0
  256.       APTR    xai_Client      * pointer to unarchiving client
  257.     APTR    xai_PrivateClient * private client data
  258.     APTR    xai_Password      * password for crypted archives
  259.     ULONG    xai_Flags        * read only XADAIF_ flags
  260.     ULONG    xai_LowCyl       * lowest cylinder to unarchive
  261.     ULONG    xai_HighCyl      * highest cylinder to unarchive
  262.     ULONG    xai_InPos        * input position, read only
  263.     ULONG    xai_InSize       * input size, read only
  264.     ULONG    xai_OutPos       * output position, read only
  265.     ULONG    xai_OutSize      * output file size, read only
  266.     APTR    xai_FileInfo      * data pointer for file arcs
  267.     APTR    xai_DiskInfo      * data pointer for disk arcs
  268.     APTR    xai_CurFile      * data pointer for current file arc
  269.     APTR    xai_CurDisk      * data pointer for current disk arc
  270.       LONG    xai_LastError      * last error, when XADAIF_FILECORRUPT (V2)
  271.     APTR    xai_MultiVolume      * array of start offsets from parts (V2)
  272.     APTR    xai_SkipInfo      * linked list of skip entries (V3)
  273.       APTR    xai_ImageInfo      * for filesystem clients (V5)
  274.     APTR    xai_InName      * Input archive name if available (V7)
  275.  
  276. * This structure is nearly complete private to either xadmaster or its
  277. * clients. An application program may access for reading only xai_Client,
  278. * xai_Flags, xai_FileInfo and xai_DiskInfo. For xai_Flags only XADAIF_CRYPTED
  279. * is useful. All the other stuff is private and should not be accessed!
  280.  
  281.     BITDEF XADAI,CRYPTED,0        * archive entries are encrypted
  282.     BITDEF XADAI,FILECORRUPT,1    * file is corrupt, but valid entries are in the list
  283.     BITDEF XADAI,FILEARCHIVE,2    * unarchive file entry
  284.     BITDEF XADAI,DISKARCHIVE,3    * unarchive disk entry
  285.     BITDEF XADAI,OVERWRITE,4    * overwrite the file (PRIVATE)
  286.     BITDEF XADAI,MAKEDIRECTORY,5    * create directory when missing (PRIVATE)
  287.     BITDEF XADAI,IGNOREGEOMETRY,6    * ignore drive geometry (PRIVATE)
  288.     BITDEF XADAI,VERIFY,7        * verify is turned on for disk hook (PRIVATE)
  289.     BITDEF XADAI,NOKILLPARTIAL,8    * do not delete partial files (PRIVATE)
  290.     BITDEF XADAI,DISKIMAGE,9    * is disk image extraction (V5)
  291.     BITDEF XADAI,FORMAT,10        * format in disk hook (PRIVATE)
  292.     BITDEF XADAI,NOEMPTYERROR,11    * do not create empty error (PRIVATE)
  293.     BITDEF XADAI,ONLYIN,12        * in stuff only (PRIVATE)
  294.     BITDEF XADAI,ONLYOUT,13        * out stuff only (PRIVATE)
  295.     BITDEF XADAI,USESECTORLABELS,14 * use SectorLabels (PRIVATE)
  296.  
  297.     STRUCTURE xadFileInfo,0
  298.     APTR    xfi_Next
  299.     ULONG    xfi_EntryNumber    * number of entry, starts with 1
  300.     APTR    xfi_EntryInfo      * additional archiver text
  301.     APTR    xfi_PrivateInfo    * client private, see XAD_OBJPRIVINFOSIZE
  302.     ULONG    xfi_Flags          * see XADFIF_xxx defines
  303.     APTR    xfi_FileName       * see XAD_OBJNAMESIZE tag
  304.     APTR    xfi_Comment        * see XAD_OBJCOMMENTSIZE tag
  305.     ULONG      xfi_Protection     * OS 3 bits (including multiuser)
  306.     ULONG    xfi_OwnerUID       * user ID
  307.     ULONG    xfi_OwnerGID       * group ID
  308.     APTR    xfi_UserName       * user name
  309.     APTR    xfi_GroupName      * group name
  310.     ULONG   xfi_Size           * size of this file
  311.     ULONG    xfi_GroupCrSize    * crunched size of group
  312.     ULONG    xfi_CrunchSize     * crunched size
  313.     APTR    xfi_LinkName       * name and path of link
  314.     STRUCT    xfi_Date,xadDate_SIZE
  315.     UWORD   xfi_Generation  * File Generation [0...$FFFF] (V3)
  316.     ULONG    xfi_DataPos     * crunched data position (V3)
  317.     APTR    xfi_MacFork     * pointer to 2nd fork for Mac (V7)
  318.  
  319. * Multiuser fields (xfi_OwnerUID, xfi_OwnerUID, xfi_UserName, xfi_GroupName)
  320. * and multiuser bits (see <dos/dos.h>) are currently not supported with normal
  321. * Amiga filesystem. But the clients support them, if archive format holds
  322. * such information.
  323.  
  324.     BITDEF XADFI,CRYPTED,0        * entry is crypted
  325.     BITDEF XADFI,DIRECTORY,1    * entry is a directory
  326.     BITDEF XADFI,LINK,2        * entry is a link
  327.     BITDEF XADFI,INFOTEXT,3        * file is an information text
  328.     BITDEF XADFI,GROUPED,4        * file is in a crunch group
  329.     BITDEF XADFI,ENDOFGROUP,5    * crunch group ends here
  330.     BITDEF XADFI,NODATE,6        * no date supported, CURRENT date is set
  331.     BITDEF XADFI,DELETED,7        * file is marked as deleted (V3)
  332.     BITDEF XADFI,SEEKDATAPOS,8    * before unarchiving the datapos is set (V3)
  333.     BITDEF XADFI,NOFILENAME,9    * there was no filename, using internal one (V6)
  334.     BITDEF XADFI,NOUNCRUNCHSIZE,10    * file size is unknown and thus set to zero (V6)
  335.     BITDEF XADFI,PARTIALFILE,11    * file is only partial (V6)
  336.     BITDEF XADFI,MACDATA,12        * file is Apple data fork (V7)
  337.     BITDEF XADFI,MACRESOURCE,13    * file is Apple resource fork (V7)
  338.  
  339. * NOTE: the texts passed with that structure must not always be printable.
  340. * Although the clients should add an additional (not counted) zero at the text
  341. * end, the whole file may contain other unprintable stuff (e.g. for DMS).
  342. * So when printing this texts do it on a byte for byte base including
  343. * printability checks.
  344.  
  345.     STRUCT xadTextInfo,0
  346.     APTR    xti_Next
  347.     ULONG    xti_Size    * maybe zero - no text - e.g. when crypted
  348.     APTR    xti_Text    * and there is no password in xadGetInfo()
  349.     ULONG    xti_Flags    * see XADTIF_xxx defines
  350.  
  351.     BITDEF    XADTI,CRYPTED,0    * entry is empty, as data was crypted
  352.     BITDEF    XADTI,BANNER,1    * text is a banner
  353.     BITDEF    XADTI,FILEDIZ,2    * text is a file description
  354.  
  355.     STRUCT xadDiskInfo,0
  356.     APTR    xdi_Next
  357.     ULONG    xdi_EntryNumber      * number of entry, starts with 1
  358.     APTR    xdi_EntryInfo        * additional archiver text
  359.     APTR    xdi_PrivateInfo      * client private, see XAD_OBJPRIVINFOSIZE
  360.     ULONG    xdi_Flags         * see XADDIF_xxx defines
  361.     ULONG    xdi_SectorSize
  362.     ULONG    xdi_TotalSectors    * see devices/trackdisk.h
  363.     ULONG    xdi_Cylinders        * to find out what these
  364.     ULONG    xdi_CylSectors          * fields mean, they are equal
  365.     ULONG    xdi_Heads          * to struct DriveGeometry
  366.     ULONG    xdi_TrackSectors
  367.     ULONG    xdi_LowCyl           * lowest cylinder stored
  368.     ULONG    xdi_HighCyl          * highest cylinder stored
  369.     ULONG    xdi_BlockInfoSize    * number of BlockInfo entries
  370.     APTR    xdi_BlockInfo        * see XADBIF_xxx defines and XAD_OBJBLOCKENTRIES tag
  371.     APTR    xdi_TextInfo        * linked list with info texts
  372.     ULONG    xdi_DataPos        * crunched data position (V3)
  373.  
  374. * BlockInfo points to a UBYTE field for every track from first sector of
  375. * lowest cylinder to last sector of highest cylinder. When not used,
  376. * pointer must be 0. Do not use it, when there are no entries!
  377. * This is just for information. The applications still asks the client
  378. * to unarchive whole cylinders and not archived blocks are cleared for
  379. * unarchiving.
  380.     BITDEF XADDI,CRYPTED,0        * entry is crypted
  381.     BITDEF XADDI,SEEKDATAPOS,1    * before unarchiving the datapos is set (V3)
  382.     BITDEF XADDI,SECTORLABELS,2    * the clients delivers sector labels (V9)
  383.  
  384. * Some of the crunchers do not store all necessary information, so it
  385. * may be needed to guess some of them. Set the following flags in that case
  386. * and geometry check will ignore these fields.
  387.     BITDEF XADDI,GUESSCYLINDERS,7      * cylinder number is guessed
  388.     BITDEF XADDI,GUESSCYLSECTORS,8      * cylsectors is guessed
  389.     BITDEF XADDI,GUESSHEADS,9      * number of heads is guessed
  390.     BITDEF XADDI,GUESSTRACKSECTORS,10 * tracksectors is guessed
  391.     BITDEF XADDI,GUESSLOWCYL,11      * lowcyl is guessed
  392.     BITDEF XADDI,GUESSHIGHCYL,12      * highcyl is guessed
  393.  
  394. * If it is impossible to set some of the fields, you need to set some of
  395. * these flags. NOTE: XADDIB_NOCYLINDERS is really important, as this turns
  396. * of usage of lowcyl and highcyl keywords. When you have cylinder information,
  397. * you should not use these and instead use guess flags and calculate
  398. * possible values for the missing fields.
  399.     BITDEF XADDI,NOCYLINDERS,15    * cylinder number is not set
  400.     BITDEF XADDI,NOCYLSECTORS,16    * cylsectors is not set
  401.     BITDEF XADDI,NOHEADS,17        * number of heads is not set
  402.     BITDEF XADDI,NOTRACKSECTORS,18    * tracksectors is not set
  403.     BITDEF XADDI,NOLOWCYL,19    * lowcyl is not set
  404.     BITDEF XADDI,NOHIGHCYL,20    * highcyl is not set
  405.  
  406. * defines for BlockInfo
  407.     BITDEF XADBI,CLEARED,0    * this block was cleared for archiving
  408.     BITDEF XADBI,UNUSED,1    * this block was not archived
  409.  
  410. *************************************************************************
  411. *                                                *
  412. *    progress report stuff                              *
  413. *                                                *
  414. *************************************************************************
  415.  
  416.     STRUCTURE xadProgressInfo,0
  417.     ULONG    xpi_Mode    * work modus
  418.     APTR    xpi_Client    * the client doing the work
  419.     APTR    xpi_DiskInfo    * current diskinfo, for disks
  420.     APTR    xpi_FileInfo    * current info for files
  421.     ULONG    xpi_CurrentSize    * current filesize
  422.     ULONG    xpi_LowCyl    * for disks only
  423.     ULONG    xpi_HighCyl    * for disks only
  424.     ULONG    xpi_Status    * see XADPIF flags
  425.     LONG    xpi_Error    * any of the error codes
  426.     APTR    xpi_FileName    * name of file to overwrite (V2)
  427.     APTR    xpi_NewName    * new name buffer, passed by hook (V2)
  428. * NOTE: For disks CurrentSize is Sector*SectorSize, where SectorSize can
  429. * be found in xadDiskInfo structure. So you may output the sector value.
  430.  
  431. * different progress modes
  432. XADPMODE_ASK        EQU    1
  433. XADPMODE_PROGRESS    EQU    2
  434. XADPMODE_END        EQU    3
  435. XADPMODE_ERROR        EQU    4
  436.  
  437. * flags for progress hook and ProgressInfo status field
  438.     BITDEF XADPI,OVERWRITE,0    * overwrite the file
  439.     BITDEF XADPI,MAKEDIRECTORY,1    * create the directory
  440.     BITDEF XADPI,IGNOREGEOMETRY,2    * ignore drive geometry
  441.     BITDEF XADPI,RENAME,10        * rename the file (V2)
  442.     BITDEF XADPI,OK,16        * all ok, proceed
  443.     BITDEF XADPI,SKIP,17        * skip file
  444.  
  445. *************************************************************************
  446. *                                                *
  447. *    errors                                       *
  448. *                                                *
  449. *************************************************************************
  450.  
  451. XADERR_OK        EQU    $0000 * no error
  452. XADERR_UNKNOWN        EQU    $0001 * unknown error
  453. XADERR_INPUT        EQU    $0002 * input data buffers border exceeded
  454. XADERR_OUTPUT        EQU    $0003 * output data buffers border exceeded
  455. XADERR_BADPARAMS    EQU    $0004 * function called with illegal parameters
  456. XADERR_NOMEMORY        EQU    $0005 * not enough memory available
  457. XADERR_ILLEGALDATA    EQU    $0006 * data is corrupted
  458. XADERR_NOTSUPPORTED    EQU    $0007 * command is not supported
  459. XADERR_RESOURCE        EQU    $0008 * required resource missing
  460. XADERR_DECRUNCH        EQU    $0009 * error on decrunching
  461. XADERR_FILETYPE        EQU    $000A * unknown file type
  462. XADERR_OPENFILE        EQU    $000B * opening file failed
  463. XADERR_SKIP        EQU    $000C * file, disk has been skipped
  464. XADERR_BREAK        EQU    $000D * user break in progress hook
  465. XADERR_FILEEXISTS    EQU    $000E * file already exists
  466. XADERR_PASSWORD        EQU    $000F * missing or wrong password
  467. XADERR_MAKEDIR        EQU    $0010 * could not create directory
  468. XADERR_CHECKSUM        EQU    $0011 * wrong checksum
  469. XADERR_VERIFY        EQU    $0012 * verify failed (disk hook)
  470. XADERR_GEOMETRY        EQU    $0013 * wrong drive geometry
  471. XADERR_DATAFORMAT    EQU    $0014 * unknown data format
  472. XADERR_EMPTY        EQU    $0015 * source file contains no files
  473. XADERR_FILESYSTEM    EQU    $0016 * unknown filesystem
  474.  
  475. *************************************************************************
  476. *                                                *
  477. *    client related stuff                           *
  478. *                                                *
  479. *************************************************************************
  480.  
  481.     STRUCTURE xadForeman,0
  482.     ULONG    xfm_Security    * should be XADFOREMAN_SECURITY
  483.     ULONG    xfm_ID              * must be XADFOREMAN_ID
  484.     UWORD    xfm_Version     * set to XADFOREMAN_VERSION
  485.     UWORD    xfm_Reserved
  486.     APTR    xfm_VersString  * pointer to $VER: string
  487.     APTR    xfm_FirstClient * pointer to first client
  488.     LABEL    xadForman_SIZE
  489.  
  490. XADFOREMAN_SECURITY    EQU    $70FF4E75 * MOVEQ #-1,D0 and RTS
  491. XADFOREMAN_ID        EQU    $58414446 * 'XADF' identification ID
  492. XADFOREMAN_VERSION    EQU    1
  493.  
  494.     STRUCTURE xadClient,0
  495.     APTR    xc_Next
  496.     UWORD    xc_Version    * set to XADCLIENT_VERSION
  497.     UWORD    xc_MasterVersion
  498.     UWORD    xc_ClientVersion
  499.     UWORD    xc_ClientRevision
  500.     ULONG    xc_RecogSize    * needed size to recog the type
  501.     ULONG    xc_Flags    * see XADCF_xxx defines
  502.     ULONG    xc_Identifier    * ID of internal clients
  503.     APTR    xc_ArchiverName
  504.     APTR    xc_RecogData
  505.     APTR    xc_GetInfo
  506.     APTR    xc_UnArchive
  507.     APTR    xc_Free
  508.     LABEL    xadClient_SIZE
  509.  
  510. * function interface
  511. * ASM(BOOL) xc_RecogData(REG(d0, ULONG size), REG(a0, STRPTR data),
  512. *        REG(a6, struct xadMasterBase *xadMasterBase))
  513. * ASM(LONG) xc_GetInfo(REG(a0, struct xadArchiveInfo *ai),
  514. *        REG(a6, struct xadMasterBase *xadMasterBase))
  515. * ASM(LONG) xc_UnArchive(REG(a0, struct xadArchiveInfo *ai),
  516. *        REG(a6, struct xadMasterBase *xadMasterBase))
  517. * ASM(void) xc_Free(REG(a0, struct xadArchiveInfo *ai),
  518. *        REG(a6, struct xadMasterBase *xadMasterBase))
  519.  
  520.  
  521. * xc_RecogData returns 1 when recognized and 0 when not, all the others
  522. * return 0 when ok and XADERR values on error. xc_Free has no return
  523. * value.
  524.  
  525. * Filesystem clients need to clear xc_RecogSize and xc_RecogData. The
  526. * recognition is automatically done by GetInfo. XADERR_FILESYSTEM is
  527. * returned in case of unknown format. If it is known detection should
  528. * go on and any other code may be returned, if it fails.
  529. * The field xc_ArchiverName means xc_FileSystemName for filesystem
  530. * clients.
  531.  
  532. XADCLIENT_VERSION    EQU    1
  533.  
  534.     BITDEF XADC,FILEARCHIVER,0    * archiver is a file archiver
  535.     BITDEF XADC,DISKARCHIVER,1    * archiver is a disk archiver
  536.     BITDEF XADC,EXTERN,2        * external client, set by xadmaster
  537.     BITDEF XADC,FILESYSTEM,3    * filesystem clients (V5)
  538.     BITDEF XADC,NOCHECKSIZE,4    * do not check size for recog call (V6)
  539.     BITDEF XADC,FREESKIPINFO,27    * master frees xadSkipInfo structures (V3)
  540.     BITDEF XADC,FREETEXTINFO,28    * master frees xadTextInfo structures (V2)
  541.     BITDEF XADC,FREETEXTINFOTEXT,29    * master frees xadTextInfo text block (V2)
  542.     BITDEF XADC,FREEFILEINFO,30    * master frees xadFileInfo structures (V2)
  543.     BITDEF XADC,FREEDISKINFO,31    * master frees xadDiskInfo structures (V2)
  544.  
  545. *************************************************************************
  546. *                                                *
  547. *    client ID's                                   *
  548. *                                                *
  549. *************************************************************************
  550.  
  551. * If an external client has set the xc_Identifier field, the internal
  552. * client is replaced.
  553.  
  554. * disk archivers start with 1000
  555. XADCID_XMASH            EQU    1000
  556. XADCID_SUPERDUPER3        EQU    1001
  557. XADCID_XDISK            EQU    1002
  558. XADCID_PACKDEV            EQU    1003
  559. XADCID_ZOOM            EQU    1004
  560. XADCID_ZOOM5            EQU    1005
  561. XADCID_CRUNCHDISK        EQU    1006
  562. XADCID_PACKDISK            EQU    1007
  563. XADCID_MDC            EQU    1008
  564. XADCID_COMPDISK            EQU    1009
  565. XADCID_LHWARP            EQU    1010
  566. XADCID_SAVAGECOMPRESSOR        EQU    1011
  567. XADCID_WARP            EQU    1012
  568.  
  569. * file archivers start with 5000
  570. XADCID_TAR            EQU    5000
  571. XADCID_SDSSFX            EQU    5001
  572. XADCID_LZX            EQU    5002
  573. XADCID_MXMSIMPLEARC        EQU    5003
  574. XADCID_LHPAK            EQU    5004
  575. XADCID_AMIGAPLUSUNPACK        EQU    5005
  576. XADCID_AMIPACK            EQU    5006
  577. XADCID_LHA            EQU    5007
  578. XADCID_LHASFX            EQU    5008
  579. XADCID_PCOMPARC            EQU    5009
  580. XADCID_SOMNI            EQU    5010
  581. XADCID_LHSFX            EQU    5011
  582. XADCID_XPKARCHIVE        EQU    5012
  583. XADCID_SHRINK            EQU    5013
  584. XADCID_SPACK            EQU    5014
  585. XADCID_SPACKSFX            EQU    5015
  586. XADCID_ZIP            EQU    5016
  587. XADCID_WINZIPEXE        EQU    5017
  588. XADCID_GZIP            EQU    5018
  589. XADCID_ARC            EQU    5019
  590. XADCID_ZOO            EQU    5020
  591. XADCID_LHAEXE            EQU    5021
  592. XADCID_ARJ            EQU    5022
  593. XADCID_ARJEXE            EQU    5023
  594. XADCID_ZIPEXE            EQU    5024
  595. XADCID_LHF            EQU    5025
  596. XADCID_COMPRESS            EQU    5026
  597. XADCID_ACE            EQU    5027
  598. XADCID_ACEEXE            EQU    5028
  599. XADCID_GZIPSFX            EQU    5029
  600. XADCID_HA            EQU    5030
  601.  
  602. * filesystem client start with 8000
  603. XADCID_FSAMIGA            EQU    8000
  604. XADCID_FSSANITYOS        EQU    8001
  605. XADCID_FSFAT            EQU    8002
  606.  
  607. * mixed archivers start with 9000
  608. XADCID_DMS            EQU    9000
  609. XADCID_DMSSFX            EQU    9001
  610.  
  611.     ENDC    ; LIBRARIES_XADMASTER_I
  612.